<template>
  <div
    v-show="error"
    class="error-container"
  >
    <div class="main-container">
      {{ message }}
      <div
        class="clo"
        @click="close"
      >
        x
      </div>
    </div>
  </div>
</template>

<script>
import { mapState, mapActions, mapMutations } from 'vuex';

// import user from '@/store/user/';

// console.log(user.error);
export default {
  computed: {
    ...mapState({
      error: (state) => state.error.error,
      message: (state) => state.error.message,
    }),

    ...mapActions(['showErr']),

  },

  methods: {
    ...mapMutations(['close']),

  },
};
</script>

<style scoped>

.error-container{
  position: fixed;
  top:0;
  left: 0;
  background-color: rgba(1, 1,1, 0.3);
  height: 100vh;
  width: 100vw;
  display: flex;
    justify-content: center;
    align-items: center;
}
.main-container{
    width: 300px;
    height: 200px;
    background-color: rgb(255, 255, 255);
    position: relative;
    display: flex;
     justify-content: center;
    align-items: center;
    vertical-align: middle;
}

.clo{
  position: absolute;
  top:0;
  right:0;
  /* right: -10px; */
  background-color: white;
  border: 1px solid #171717;
  padding: 1px 6px;
  cursor: pointer;
}
</style>
